<?php

require_once './application/core/CoreBase.php';
require_once './application/models/Tables/cache.php';
require_once './application/entity/admin/sizecache.php';

class cacheAdm extends CoreBase
{

    private $_obj;
    private $_size;

    public function getSizeCache()
    {
        $this->_obj = new cache();
        $this->_size = $this->_obj->getSize($this->_controller->_idClient);
        $this->_obj = new sizeCache();
        $this->_obj->sizeAll = $this->_size[0];
        $this->_obj->sizeSession = count($this->_size[1]);
        echo Zend_Json_Encoder::encode($this->_obj);
    }

    public function emptyCache()
    {
        $this->_obj = new cache();
        $this->_size = $this->_obj->deleteAllInfo();
    }

    public function emptyCacheSession()
    {
        $this->_obj = new cache();
        $this->_size = $this->_obj->deleteAllInfoSession($this->_controller->_idClient);
    }

}